<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="lib/nprogress/nprogress.css">
    <!--bootstrap-->
    <link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css">
    <!--表单验证插件的css-->
    <link rel="stylesheet" href="lib/bootstrap-validator/css/bootstrapValidator.min.css">
    <!--自已写的css-->
    <link rel="stylesheet" href="./css/common.css">
    <link rel="stylesheet" href="./css/product.css">

    <script src="lib/jquery/jquery.min.js"></script>
    <!--模板引擎-->
    <script src="lib/artTemplate/template-web.js"></script>
    <!--bootstrap-->
    <script src="lib/bootstrap/js/bootstrap.js"></script>
    <!--分页器-->
    <script src="lib/bootstrap-paginator/bootstrap-paginator.min.js"></script>
    <!--表单验证插件-->
    <script src="lib/bootstrap-validator/js/bootstrapValidator.min.js"></script>
    <!--图表插件-->
    <script src="lib/echarts/echarts.min.js"></script>
    <!--上传文件的插件-->
    <script src="lib/jquery-fileupload/jquery.ui.widget.js"></script>
    <script src="lib/jquery-fileupload/jquery.fileupload.js"></script>
    <script src="lib/jquery-fileupload/jquery.iframe-transport.js"></script>
    <!--进度条插件-->
    <script src="lib/nprogress/nprogress.js"></script>
    <!--自已写的js-->
    <script src="./js/commom.js"></script>
    <script src="./js/product.js"></script>


</head>

<body>
    <div class="main">
        <div class="left">
            <div class="title">ITCAST</div>
            <div class="icon">
                <img src="./images/default.png" alt="">
                <p>超级管理员</p>
            </div>
            <ul class="menu">
                <li>
                    <a href="./user.html">
                        <span class="glyphicon glyphicon-user"></span>用户管理</a>
                </li>
                <li>
                    <a href="javascript:void()" class="toggleMenu">
                        <span class="glyphicon glyphicon-list"></span>分类管理</a>
                    <div class="submenu">
                        <a href="./category.html">一级分类</a>
                        <a href="./subcategory.html">二级分类</a>
                    </div>
                </li>
                <li>
                    <a class="active" href="./product.html">
                        <span class="glyphicon glyphicon-tags"></span>商品管理</a>
                </li>
            </ul>
        </div>
        <div class="right">
            <div class="topBar">
                <span class="glyphicon glyphicon-align-justify pull-left"></span>
                <span class="glyphicon glyphicon-log-out pull-right"></span>
            </div>
            <ol class="breadcrumb">
                <li>
                    <a href="#">管理系统</a>
                </li>
                <li>
                    <a href="#">商品分类</a>
                </li>
            </ol>
            <div class="content charts container-fluid">
                <button class="addproduct btn btn-default">添加商品</button>
                <table class="table table-hover table-bordered">
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>商品名称</th>
                            <th>商品描述</th>
                            <th>商品库存</th>
                            <th>商品尺寸</th>
                            <th>商品状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>

                    </tbody>
                </table>
                <div class="pull-right">
                    <ul class="pagination"></ul>
                </div>
            </div>
        </div>
    </div>
    <!-- 商品模板引擎 -->
    <script id='product-model' type="text/html">
        {{each rows}}
        <tr>
            <td>{{(page-1)*size+$index+1}}</td>
            <td>{{$value.proName}}</td>
            <td>{{$value.proDesc}}</td>
            <td>{{$value.num}}</td>
            <td>{{$value.size}}</td>
            <td>
                {{if $value.statu==1}}已上架{{/if}} {{if $value.statu==0}}已下架{{/if}}
            </td>
            <td>
                {{if $value.statu==1}}
                <button class="btn btn-danger">下架</button>{{/if}} {{if $value.statu==0}}
                <button class="btn btn-success">上架</button>{{/if}}
            </td>
        </tr>
        {{/each}}
    </script>
    <script id='product-dropdown' type="text/html">
        {{each rows}}
        <li>
            <a data-id='{{$value.id}}' href="#">{{$value.categoryName}}</a>
        </li>
        {{/each}}
    </script>

    <!-- 添加商品的模态框 -->
    <div id="addproduct-modal" class="modal fade bs-example-modal-md" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-md" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">添加商品</h4>
                </div>
                <div class="modal-body">
                    <form>
                        <div class="dropdown form-group">
                            <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true"
                                aria-expanded="true">
                                <span class="text">请选择二级分类</span>
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                                <li>
                                    <a href="#">Action</a>
                                </li>
                            </ul>
                            <input type="hidden" name="brandId">
                        </div>
                        <div class="form-group">
                            <input name='proName' type="text" class="form-control" placeholder="请输入商品名称">
                        </div>
                        <div class="form-group">
                            <textarea rows="3" name='proDesc' type="text" class="form-control" placeholder="请输入商品描述"></textarea>
                        </div>
                        <div class="form-group">
                            <input name='num' type="text" class="form-control" placeholder="请输入商品库存">
                        </div>
                        <div class="form-group">
                            <input name='size' type="text" class="form-control" placeholder="请输入商品尺码(例如:30-50)">
                        </div>
                        <div class="form-group">
                            <input name='oldPrice' type="text" class="form-control" placeholder="请输入商品原价">
                        </div>
                        <div class="form-group">
                            <input name='price' type="text" class="form-control" placeholder="请输入商品价格">
                        </div>
                        <div class="form-group file-group">
                            <input type="file" id="fileupload" name="pic1" data-url="/product/addProductPic" multiple>
                            <button type="button" class="btn btn-default">上传图片</button>
                        </div>
                        <div class="form-group">
                            <input type="hidden" name="brandLogo">
                            <div class="imgbox"></div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-primary">确定</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->

    <!-- 退出登陆的模态框 -->
    <div id="logout-modal" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-sm" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">温馨提示</h4>
                </div>
                <div class="modal-body">
                    <p>
                        <span class="glyphicon glyphicon-info-sign"></span>您确定要退出后台管理系统吗？</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-primary">确定</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->
</body>

</html>